<?php
/**
 * Created by JetBrains PhpStorm.
 * User: zhouyang
 * Date: 13-7-15
 * Time: 下午4:31
 * To change this template use File | Settings | File Templates.
 */
class UserHasRolesModel extends Model{
    /**
     * @tudo 查询用户拥有的角色
     * @param $user_id
     * @return array|mixed
     */
    public function getUserHasRoles($user_id){
        $row = $this->dbreader()->getUserHasRoles($user_id);

        return $row;
    }

    //添加用户拥有的角色信息
    public function addUserHasRoles($user_id,$role_id){
        $ret = $this->dbreader()->addUserHasRoles($user_id,$role_id);

        return $ret;
    }

    //删除 role_id 对应的信息
    public function delByRoleId($role_id){
        $ret = $this->dbreader()->delByRoleId($role_id);

        return $ret;
    }

    //删除 user_id 对应的信息
    public function delByUserId($user_id){
        $ret = $this->dbreader()->delByUserId($user_id);

        return $ret;
    }
}